<!--
 * @Descripttion: 
 * @version: 
 * @Author: luhe
 * @Date: 2022-07-06 16:03:48
 * @LastEditors: luhe
 * @LastEditTime: 2023-02-16 18:01:16
-->
<template>
  <!-- <img alt="Vue logo" src="../assets/logo.png" /> -->
  <HelloWorld msg="Hello Vue + Vite" />
  <a-button type="primary">Primary Button</a-button>
  <a-button @click="go">Default Button</a-button>
</template>

<script>
import HelloWorld from '../components/HelloWorld.vue'
import { useRouter } from "vue-router";
import { ref, defineComponent } from 'vue'
export default defineComponent ({
  components: {
    HelloWorld
  },
  setup() {
    const router = useRouter()
    const clickMethods = {
      go() {
        router.push({path: '/demo'})
      }
    }
    const count = ref(0)
    // const year = ref<String | Number>('2023')
    console.log(count.value) // 0
    // console.log(year.value)

    // count.value++
    // console.log(count.value) // 1

    return {
      ...clickMethods
    }
  },
  mounted() {
    let obj = new Promise((reslove, reject) => {
      reslove()
    })

    let obj2 = new Promise((reslove, reject) => {
      // reject()
    })

    obj.then((res) => {
      // console.log(res, 44);
    }, (err) => {
      // console.log(err, 46);
    })

  },
  methods: {
    // go() {
    //   this.$router.push({path: '/demo'})
    // }
  }
})
</script>

<style>

</style>